#include <bits/stdc++.h>
using namespace std;
string s;
int main()
{
	int n;
	cin>>n;
	int flag=1;
	while(n--)
	{
		int k,m;
		cin>>k>>m;
		printf("Team #%d\n",flag);
		printf("Games: %d\n",k);
		printf("Points: %d\n",m);
		printf("Possible records:\n");
		int a=m/3,b=m%3,c=k-a-b;
		while(a+b<=k&&a>=0)
		{
			printf("%d-%d-%d\n",a,b,c);
			a--;
			b+=3;
			c=k-a-b;
		}
		flag++;
		cout<<endl;
	}
 } 
